/*    */ package com.zimbra.cs.util.yauth;
/*    */ 
/*    */ import com.zimbra.cs.mailclient.MailConfig;
/*    */ import com.zimbra.cs.mailclient.auth.Authenticator;
/*    */ import java.io.UnsupportedEncodingException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class XYMEAuthenticator
/*    */   extends Authenticator
/*    */ {
/*    */   private final Auth auth;
/*    */   private final String partner;
/*    */   public static final String MECHANISM = "XYMECOOKIE";
/*    */   
/*    */   public XYMEAuthenticator(Auth auth, String partner)
/*    */   {
/* 36 */     this.auth = auth;
/* 37 */     this.partner = partner;
/*    */   }
/*    */   
/*    */   public void init(MailConfig config, String password)
/*    */   {
/* 42 */     throw new UnsupportedOperationException();
/*    */   }
/*    */   
/*    */   public String getMechanism()
/*    */   {
/* 47 */     return "XYMECOOKIE";
/*    */   }
/*    */   
/*    */   public byte[] evaluateChallenge(byte[] challenge)
/*    */   {
/*    */     try {
/* 53 */       String response = String.format("cookies=%s appid=%s wssid=%s src=%s", new Object[] { this.auth.getCookie(), this.auth.getAppId(), this.auth.getWSSID(), this.partner });
/*    */       
/*    */ 
/* 56 */       return response.getBytes("UTF-8");
/*    */     } catch (UnsupportedEncodingException e) {
/* 58 */       throw new InternalError();
/*    */     }
/*    */   }
/*    */   
/*    */   public boolean isComplete()
/*    */   {
/* 64 */     return true;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/util/yauth/XYMEAuthenticator.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */